package com.cbw.util.page;

public class PageBean {
	public static final int DEFAULT_PAGE_SIZE = 20;

	public int count = 0;
	public int pageSize = DEFAULT_PAGE_SIZE;
	public int currentPage = 1;
	public int nextPage;
	public int previousPage;
	public int pageCount = 1;
	public int pageStart = 1;
	public int pageEnd = 1;
	public int previousCount = 0;

	public int getCount() {
		return count;
	}
	public void setCount(int count) {
		this.count = count;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public int getNextPage() {
		return nextPage;
	}
	public void setNextPage(int nextPage) {
		this.nextPage = nextPage;
	}
	public int getPreviousPage() {
		return previousPage;
	}
	public void setPreviousPage(int previousPage) {
		this.previousPage = previousPage;
	}
	public int getPageCount() {
		if (count % pageSize == 0) {
			return count / pageSize;
		} else {
			return count / pageSize + 1;
		}
	}
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	public int getPageStart() {
		return pageStart;
	}
	public void setPageStart(int pageStart) {
		this.pageStart = pageStart;
	}
	public int getPageEnd() {
		return pageEnd;
	}
	public void setPageEnd(int pageEnd) {
		this.pageEnd = pageEnd;
	}
	public int getPreviousCount() {
		return (currentPage - 1) * pageSize;
	}

}
